function chg_mark_image(this_cmi) {
	if (timer_cmi) {
		clearTimeout(timer_cmi);
	}
	
	if (last_cmi == this_cmi) {
		return;
	}
	
	if (nav_filter) {
		$('html_a_'+this_cmi).filters.blendTrans.Apply();
		$('html_a_'+this_cmi).style.display = 'block';
		$('html_a_'+this_cmi).filters.blendTrans.play();
		
		//$('html_a_'+this_cmi).filters.blendTrans.Apply();
		$('html_a_'+last_cmi).style.display = 'none';
		//$('html_a_'+this_cmi).filters.blendTrans.play();
	}
	else {
		$('html_a_'+this_cmi).style.display = 'block';
		$('html_a_'+last_cmi).style.display = 'none';
	}
	$('img_a_'+last_cmi).src = '/1012/img/index/ad_ns_b.gif';
	$('img_a_'+this_cmi).src = '/1012/img/index/ad_sel.gif';
	
	last_cmi = this_cmi;
	
	this_cmi++;
	if (this_cmi >= cmi_t) {
		this_cmi = 0;
	}

	timer_cmi = setTimeout('chg_mark_image('+this_cmi+')', 5000);
}

function showBigImage(id,obj)
{	
	var scrollTop = window.pageYOffset|| document.documentElement.scrollTop|| document.body.scrollTop|| 0;
	if(scrollTop>0)
		document.documentElement.scrollTop=0;
	defaultImageUrl=obj.childNodes[0].childNodes[0].src;
	defalutImage();
	var url="/index.php";
	var pars="act=showImage&id="+id;
	var ajax=new AjaxRequest(url,{method:"get",parameters:pars,onComplete:responseImageMessage});
	ajax.Create();
}

function responseImageMessage(originHttpRequest)
{
	var response=originHttpRequest.responseText;
	//alert(response);
	if(response)
	{
		var arr=response.split("|");
		$("logo_brand").src="../upload/brand/"+arr[0];
		$("big_image").src="../upload/brand/"+arr[1];
		if(arr[4]=="1")
		{
			$("look_frash").childNodes[0].src="/img/index/fla.gif";
			$("look_frash").style.cursor="auto";
			$("look_frash").href="index.php?act=ad&id="+arr[2]+"&flag=1";
		}
		if(arr[4]=="0")
		{
			$("look_frash").childNodes[0].src="img/index/no_flash.gif";//不能观看动画
			$("look_frash").style.cursor="default";
			$("look_frash").href="#";
		}

		$("enter_shop").style.display="";
		$("no_enter_shop").style.display="none";
		$("enter_sell").parentNode.href="index.php?act=showsort&id="+arr[2];
		$("entry_selling").href="index.php?act=showsort&id="+arr[2];
		$("entry_selling").childNodes[0].style.cursor="pointer";
		$("brand_story_link").href="/brand_story.php?id="+arr[2];
		$("brand_story_link").target="_blank";
		$("brand_story_link").childNodes[0].style.cursor="auto";
		$("brand_story_link").childNodes[0].src="/img/index/tale.gif";
	}
}


function showBigImage2(id,obj)
{	
	defaultImageUrl=obj.childNodes[0].childNodes[0].src;
	defalutImage();
	var url="/index.php";
	var pars="act=showImage&id="+id;
	var ajax=new AjaxRequest(url,{method:"get",parameters:pars,onComplete:responseImageMessage2});
	ajax.Create();
}

function responseImageMessage2(originHttpRequest)
{
	var response=originHttpRequest.responseText;
	//alert(response);
	if(response)
	{
		var arr=response.split("|");
		$("logo_brand").src="../upload/brand/"+arr[0];
		$("big_image").src="../upload/brand/"+arr[1];
		if(arr[4]=="1")
		{
			$("look_frash").childNodes[0].src="/img/index/fla.gif";
			$("look_frash").style.cursor="auto";
			$("look_frash").href="index.php?act=ad&id="+arr[2]+"&flag=1";
		}
		if(arr[4]=="0")
		{
			$("look_frash").childNodes[0].src="img/index/no_flash.gif";//不能观看动画
			$("look_frash").style.cursor="default";
			$("look_frash").href="#";
		}

		if(arr[5]=="1")
		{
			$("brand_story_link").href="/brand_story.php?id="+arr[2];
			$("brand_story_link").childNodes[0].style.cursor="auto";
			$("brand_story_link").childNodes[0].src="/img/index/tale.gif";
		}
		if(arr[5]=="0")
		{	
			$("brand_story_link").href="#";
			$("brand_story_link").childNodes[0].src="/img/index/pinpaigushi.gif";
			$("brand_story_link").childNodes[0].style.cursor="default";
			$("brand_story_link").target="_self";
		}
//		$("look_frash").href="index.php?act=ad&id="+arr[2]+"&flag=1";
		
		$("no_enter_shop").style.display="";
		$("enter_shop").style.display="none";
		$("entry_selling").href="#";
		$("entry_selling").childNodes[0].style.cursor="default";
		$("no_enter_shop").childNodes[0].id=arr[2];
//		$("brand_story_link").href="/brand_story.php?id="+arr[2];
		$("showcontent").innerHTML=arr[3];
		//$("sell_time_message").innerHTML="此品牌将在"+arr[4]+"开售，期待您的光临。";
		$("sell_time_message").innerHTML="该品牌暂未开售，我们将在开售当天以邮件形式通知您。";


		var url="/index.php";
		var pars="act=statNextBrand&id="+arr[2];
		var ajax=new AjaxRequest(url,{method:"get",parameters:pars,onComplete:responseStatB});
		ajax.Create();

	}
	
}

function responseStatB(){}


function showDiv()
{
	$("invite_email").style.display="";
}
		
function send_email_for_you(obj,brand_name,id,user_name,special_events,date_end ,f_id,date_dif)
{
	$('hidMailFrame').src = '/statistic.php?brand_id=' + id;	//开售前通知我，品牌的点击
  
	if($("L_user_name"))
	{ 
		if(date_dif == 0   && f_id == 1 && special_events == 1) 
		{ 
		
			$("send_email_div").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="images/btn.gif" onClick="L_colosediv()" /></div><div class="div_se_3"><table cellpadding="0" cellspacing="0"><tr><td><img src="../img/shop/gwc_smile.gif" /></td><td class="td_se_1"<span style="font-size:12px;color:#000000"><span id="showcontent"></span>将在<span id="showdate"></span>10点开售，记得来抢购哦！</td></tr></table><p style="margin:50px 2px 80px 80px;"> <input type="image" src="../images/c_llspp.gif" onclick="tiao(2)" /><input type="image" src="../images/c_ksqtzw.gif"  onclick="send_email_for()" /></p></div></div>';
			$("showdate").innerHTML=date_end;
		}
		else if(date_dif == 1   && f_id == 1 && special_events == 1) 
		{
			$("send_email_div").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="images/btn.gif" onClick="L_colosediv()" /></div><span style="float:left;width:268px;margin: 50px 1px 40px 60px;;line-height:25px font-size:12px;color:#000000" ><span id="showcontent"></span>&nbsp;&nbsp;&nbsp;因故不能准时开售，具体开售时间请继续留意唯品会网站。给您造成不便敬请见谅！</span></td></tr><tr><td>  <p style="margin:50px 2px 80px 110px;"> <input type="image" src="../images/c_llspp.gif" onclick="tiao(2)"/> <input type="image" src="../images/c_ksqtzw.gif"  onclick="send_email_for()" /></p></td></tr></table></div></div>';
		}
		else if(date_dif == 0   && f_id == 2 && special_events == 1) 
		{
			$("send_email_div").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="../img/shop/X.gif" onClick="L_colosediv()" /></div><div class="div_se_3"><table cellpadding="0" cellspacing="0"><tr><td><img src="../img/shop/clubsmile.gif" /></td><td class="td_se_1"<span style="font-size:12px;color:#000000"><span id="showcontent"></span>将在<span id="showdate"></span>开售，记得来抢购哦！</td></tr></table><p style="margin:50px 2px 80px 80px;"> <input type="image" " src="../images/c_llspp.gif" onclick="tiao(1)" /><input type="image" src="../images/c_ksqtzw.gif"  onclick="send_email_for(1)" /></p></div></div>';
		document.getElementById('send_email_div').style.background="url(../img/shop/clubtkbg.gif)"; 
		//document.getElementById("send_email_div").setAttribute('style', 'border:16px solid #987D8C;'); 
		
		var style = document.getElementById("send_email_div").getAttribute('style');
					document.getElementById("send_email_div").setAttribute('style', style + ';border:16px solid #987D8C; height:150px;'); 
		$("showdate").innerHTML=date_end;
		}
		else if(date_dif == 1  && f_id == 2 && special_events == 1)
		{
			
		$("send_email_div").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="../img/shop/X.gif" onClick="L_colosediv()" /></div><span style="float:left;width:268px;margin: 20px 1px 20px 80px;line-height:25px font-size:12px;color:#000000" ><span id="showcontent"></span>因故不能准时开售，具体开售时间请继续留意唯品会网站。给您造成不便敬请见谅！</span></td></tr><tr><td>  <p style="margin:50px 2px 80px 110px;"> <input type="image" src="../img/shop/clubllzspp.gif" /> <input type="image" src="../img/shop/clubksqtzw.gif"  onclick="send_email_for(1)" /></p></td></tr></table></div></div>';
		document.getElementById('send_email_div').style.background="url(../img/shop/clubtkbg.gif)"; 
		//document.getElementById("send_email_div").setAttribute('style', 'border:16px solid #987D8C;'); 
		
		var style = document.getElementById("send_email_div").getAttribute('style');
					document.getElementById("send_email_div").setAttribute('style', style + ';border:16px solid #987D8C; height:150px;'); 


		}
		else if ($("send_email_div").innerHTML == '') {
			$("send_email_div").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="images/btn.gif" onClick="L_colosediv()" /></div><div class="div_se_3"><table cellpadding="0" cellspacing="0"><tr><td><img src="/images/ksk_07.gif" /></td><td class="td_se_1">您已经成功订制了<span id="showcontent"></span>的开售通知！该品牌暂未开售，我们将在开售当天以邮件形式通知您。</td></tr></table></div></div>';
		
		}
		
		$("showcontent").innerHTML=brand_name;
		L_small_div=$("send_email_div");
	
	
		showlayer();
		
	

		//记录
		var url="/nologin_send_email.php";
		var pars="act=loginSave&id="+id;
		var ajax=new AjaxRequest(url,{method:"get",parameters:pars,onComplete:responseSaveEmail});
		ajax.Create();
	}
	else
	{
		//未登录
		if ($("send_email_nologin").innerHTML == '') {
			$("send_email_nologin").innerHTML = '<div class="div_se_2"><img onClick="L_colosediv()" src="/images/btn.gif" /></div><div class="div_sen_1"><img src="/images/ksk_07.gif" width="60" height="60"/></div><div class="div_sen_2">您定制的<span id="sp_b_name"></span>暂未开售，我们将在开售当天以手机短信或电子邮件通知您。</div><div class="div_sen_3">请输入接收方式：</div><div class="div_sen_4"><ul><li><input id="notice_type1" name="notice_type" value="1" type="radio" checked="checked" /></li><li>短信通知：</li><li><input id="yourEmail2" class="yourEmail" name="yourEmail2" tabindex="2" type="text" onkeydown="if(event.keyCode==13)nologin_send_email()" maxlength="19" value="请输入手机号码" onfocus="if (this.value==\'请输入手机号码\')this.value=\'\'" /></li><li> （短信通知更及时）</li></ul><br /></div><div class="div_sen_4"><ul><li><input id="notice_type2" name="notice_type" value="2" type="radio" /></li><li>邮件通知：</li><li><input id="yourEmail" class="yourEmail" checked="checked" name="yourEmail" tabindex="2" type="text" onkeydown="if(event.keyCode==13)nologin_send_email();" value="请输入您的邮箱" onfocus="if (this.value==\'请输入您的邮箱\')this.value=\'\'" /></li></ul><br /></div><div class="div_sen_5"><input type="image" src="/images/ksk_11.gif" name="Submit2" tabindex="3" onclick="nologin_send_email()" /></div><span id="tmp_brand_id"></span> <div style="padding: 15px 15px 0px 15px;">* 如果你不希望通过短信、邮件接收，试试泡泡吧！桌面小助手，优惠资讯更丰富！ <a href="widget/download.php" target="_blank" style="color:#EB5792">了解详情</a></div>';
		}
		L_small_div=$("send_email_nologin");
		showlayer();
		$("sp_b_name").innerHTML=brand_name;
		$("tmp_brand_id").innerHTML=id;
		$("nologin_message").innerHTML=brand_name;
		$("showcontent").innerHTML=brand_name;
		//alert($('showcontent').innerHTML);
	}
}
function send_email_for(id)
{  
	L_colosediv();
if(id==1){

			$("send_email_nologin").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="../img/shop/X.gif" onClick="L_colosediv()" /></div><div style="float:left;width:268px;margin:30px auto 0 auto;line-height:25px "><div><span style="float:left;width:268px;margin: 20px 1px 20px 80px;line-height:25px font-size:12px;color:#000000" >您已经成功订阅该品牌，我们将在开售前以邮件形式通知您。</span></div></td></tr></table></div></div>';
			document.getElementById('send_email_nologin').style.background="url(../img/shop/clubtkbg.gif)"; 
		//document.getElementById("send_email_div").setAttribute('style', 'border:16px solid #987D8C;'); 
		var style = document.getElementById("send_email_nologin").getAttribute('style');
					document.getElementById("send_email_nologin").setAttribute('style', style + ';border:16px solid #987D8C; height:150px;'); 
	
}else
{
		//	$("send_email_nologin").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="images/btn.gif" onClick="L_colosediv()" /></div><div style="float:left;width:268px;margin:30px auto 0 auto;line-height:25px "><div><span style="float:left;width:268px;margin: 20px 1px 20px 80px;line-height:25px font-size:12px;color:#000000" >您已经成功订阅该品牌，我们将在开售前以邮件形式通知您。</span></div></td></tr></table></div></div>';
	
					$("send_email_nologin").innerHTML = '<div class="div_se_1"><div class="div_se_2"><img src="images/btn.gif" onClick="L_colosediv()" /></div><div class="div_se_3"><table cellpadding="0" cellspacing="0"><tr><td><img src="images/ksk_07.gif" /></td><td class="td_se_1">您已经成功订阅该品牌，我们将在开售前以邮件形式通知您。</td></tr></table></div></div>';
					
				var style = document.getElementById("send_email_nologin").getAttribute('style');
					document.getElementById("send_email_nologin").setAttribute('style', style + '; height:150px;'); 
	
}
		//$("showcontent").innerHTML=brand_name;
		L_small_div=$("send_email_nologin");
		showlayer();

		//alert($('showcontent').innerHTML);
	
}
function close_invite_email()
{
	$("invite_email").style.display="none";
}
function tiao(id)
{  if(id == 1){self.location='/club/'; }
   else{self.location='/';}
}

//没有登录的情况下准备发送邮件

function nologin_send_email()
{
	
	var yourEmail=trim($("yourEmail").value);
	var yourEmail2=trim($("yourEmail2").value);
	var id=$("tmp_brand_id").innerHTML;
	var patn = /^1[0-9]{10}$/;
	
	if($('notice_type1').checked && !patn.test(yourEmail2))
	{
		alert("手机号码格式不对。");
		return false;
	}
	if($('notice_type2').checked && !is_email(yourEmail))
	{
		alert("邮件地址格式不对。");
		return false;
	}
	L_colosediv();
	var url="nologin_send_email.php";
	if ($('notice_type1').checked)
		var eft_value=yourEmail2;
	else
		var eft_value=yourEmail;
	var pars="act=save&id="+id+"&email="+encodeURI(eft_value);
	var ajax=new AjaxRequest(url,{method:"get",parameters:pars,onComplete:responseSaveEmail});
	ajax.Create();
	$("yourEmail").value = '请输入您的邮箱';
	$("yourEmail2").value = '请输入手机号码';
	/*$("showcontent").innerHTML=$("sp_b_name").innerHTML;
	L_small_div=document.getElementById("send_email_div");
	showlayer();*/
	if ($('notice_type1').checked)
		var k_type = '短信';
	else
		var k_type = '邮件';
	alert('您已经成功订制了' + $("sp_b_name").innerHTML + '的开售通知！该品牌暂未开售，我们将在开售当天以'+k_type+'形式通知您。');
	window.open('/invitation.php?reg_name=' + encodeURI(eft_value));
}

function responseSaveEmail(originHttpRequest)
{
	var response=originHttpRequest.responseText;
	if(response)
	{
		if(response=="false")
		{
			alert("申请发送邮件不成功");
			return false;
		}
		else if(response.indexOf("@")>0)
		{
			//window.open("/invitation.php?user_email="+response);
			return ;
		}
			
	}
}

function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g,'');
}

function showsize()
{
	
	if ($('pp').style.display != 'none')
		$('pp').style.display = 'none';
	$("gl_size").style.display='block';
}

function showpp()
{
	/*if ($('gl_size').style.display != 'none')
		$('gl_size').style.display = 'none';
	*/
	$("pp").style.display='block';
}

//goods_sort_id:分类,sort_id:取消,sizes:尺码,sort:排序,filter:是否选择有库存的商品,
function search_goods(t) {
	if (t == 'c') {
		$('filter_sz').checked = $('filter').checked
	}
	else if (t == 't' ) {
		$('filter').checked = $('filter_sz').checked
	}

	var para = '', c = document.getElementsByName('cb_sizes[]');

	for (var i=0; i<c.length; i++) {
		if (c[i].checked)
			para += c[i].value + '|';
	}
	if (para != '') {
		base_url += '&sizes=' + para;
		para = '';
	}

	if (t == '') {
		base_url += '&sort=' + old_sort;
	}
	else {
		base_url += '&sort=' + t;
	}
	if ($('filter').checked) {
		base_url += '&filter=1';
	}
	else {
		base_url += '&filter=0';
	}
	/*if ($('filter_sz').checked) {
		base_url += '&filterSz=1';
	}
	else {
		base_url += '&filterSz=0';
	}*/

	location = base_url;
}

function get_ajax_sizes() {
	showbrand();
	
	var para = '';
	var c = document.getElementsByName('cb_cat[]');
	for (var i=0; i<c.length; i++) {
		if (c[i].checked)
			para += c[i].value + '-';
	}
	
	if (para == old_para_v)
		return;
	
	$('dv_az_contnet').innerHTML = '数据载入中，请稍后...';
	getinfo('dv_az_contnet', base_url+'&act=get_size&cat_id='+para);
	old_para_v = para;
}

function chk_all_option(n, obj) {
	var c = document.getElementsByName(n);
	for (var i=0; i<c.length; i++) {
		c[i].checked = obj.checked;
	}
}

function clk(i, menu) {
    for(var n=0;n<cat_num;n++)
	{
		$('div'+n).className='undis';
	}
	$('div'+i).className='dis';
	if($('div'+i).style.display=='block'){
		menu.className='liCalss_A list_sprites';
		$('div'+i).style.display='none';
		
	} else{
		menu.className='liCalss_B list_sprites';
		$('div'+i).style.display='block';
	}
}

//下拉弹出框
function InitPopupMenu(outDiv, innDiv, ulList) {
	var obj_outDiv = document.getElementById(outDiv);
	var obj_innDiv = document.getElementById(innDiv);
	var obj_ulList = document.getElementById(ulList);
	var liObj = obj_ulList.getElementsByTagName("li");
	var childDiv = obj_outDiv.children;
	obj_outDiv.showDiv = function () {
		obj_outDiv.className = "oBox hover";
		childDiv[1].style.visibility = "visible";
		for (var j = 0; j < liObj.length; j++) {
			
			liObj[j].showSubDiv = function () {
				var subHidDiv = this.children;
				this.className = "hover";
				subHidDiv[1].style.visibility = "visible";
				obj_innDiv.style.width = (139 + subHidDiv[1].offsetWidth) - 30 + "px";
				if (subHidDiv[1].offsetHeight > obj_ulList.offsetHeight) {
					obj_innDiv.style.height = subHidDiv[1].offsetHeight + 35 + "px";
				}
				if (subHidDiv[1].offsetHeight > 300) {
					subHidDiv[1].style.width = 289 + "px";
					subHidDiv[1].style.height = 300 + "px";
					subHidDiv[1].style.overflowY = "scroll";
					subHidDiv[1].style.overflowX = "hidden";
				}
			}
			liObj[j].hidSubDiv = function () {
				this.className = "";
				var subHidDiv = this.children;
				subHidDiv[1].style.visibility = "hidden";
				obj_innDiv.style.height = "auto";
			}
			// 鼠标停留0.3秒显示
			liObj[j].onmouseover=function(){
				this.UpdateTimer(400, "FadingIn");
			}  
			// 鼠标离开0.3秒隐藏
			liObj[j].onmouseout=function(evt){
				var relatedTarget = null;
				// 兼容FF和IE，IE使用event全局变量代表事件对象，FF使用参数传入
				if (evt == null){
					evt = event;
				}
				// 对于mouseout事件，FF下的relatedTarget对应IE8下的toElement
				if (("relatedTarget" in evt)){
					relatedTarget = evt.relatedTarget;
				}
				else if (("toElement" in evt)){
					relatedTarget = evt.toElement	;
				}
				else {
					alert("没有找到事件的来源，可能是浏览器引起的错误!");
				}
				var is_in_child = IsChildOf(this, relatedTarget);
				if (is_in_child) return;
				this.UpdateTimer(400, "FadingOut");
			}
			// 定时器
			liObj[j].OnTimer = function () {
				if (this.status == "FadingOut"){
					this.hidSubDiv();
				}
				else if (this.status == "FadingIn"){
					this.showSubDiv();
				}
				this.timer_id = null;
				this.status = null;
			}
			// 更新状态
			liObj[j].UpdateTimer = function (interval, status){
				if ("timer_id" in this && this.timer_id != null){
					clearTimeout(this.timer_id);
					this.timer_id = null;
				}
				var outter_this = this;
				// 为了调用OnTimer函数中有this 指针，必须使用闭包
				function TimeoutWrapper(){
					outter_this.OnTimer();
				}
				this.timer_id = setTimeout(TimeoutWrapper, interval);
				this.status = status;
			}
			
			//计算二级层的显示位置			
			var div_obj = liObj[j].children[1];
			var total_sub = liObj.length;
			var percentage = 1;
			if (total_sub == 1) {
				percentage = 0;
			}
			else {
				percentage = j / (total_sub - 1);
			}
			var base_top = -((div_obj.offsetHeight - 32) * percentage);
			var max_top = -32 * j;

			if (navigator.userAgent.indexOf("MSIE") > 0) {
				var base_top = -((div_obj.offsetHeight - 32) * percentage) - 2;
				var max_top = -32 * j - 2;
			}
			div_obj.style.top = Math.max(base_top, max_top) + "px";
		}
	}
	obj_outDiv.hidDiv = function () {
		obj_outDiv.className = "oBox";
		childDiv[1].style.visibility = "hidden";
	}
	// 鼠标停留0.3秒显示
	obj_outDiv.onmouseover=function(){
		this.UpdateTimer(400, "FadingIn");
	}  
	// 鼠标离开0.3秒隐藏
	obj_outDiv.onmouseout=function(evt){
		var relatedTarget = null;
		// 兼容FF和IE，IE使用event全局变量代表事件对象，FF使用参数传入
		if (evt == null) {
			evt = event;
		}
		// 对于mouseout事件，FF下的relatedTarget对应IE8下胡toElement
		if (("relatedTarget" in evt)){
			relatedTarget = evt.relatedTarget;
		}
		else if (("toElement" in evt)){
			relatedTarget = evt.toElement	;
		}
		else {
			alert("没有找到事件的来源，可能是浏览器引起的错误!");
		}
		var is_in_child = IsChildOf(this, relatedTarget);
		if (is_in_child) return;
		this.UpdateTimer(400, "FadingOut");
	}
	// 定时器
	obj_outDiv.OnTimer = function () {
		if (this.status == "FadingOut"){
			this.hidDiv();
		}
		else if (this.status == "FadingIn"){
			this.showDiv();
		}
		this.timer_id = null;
		this.status = null;
	}
	// 更新状态
	obj_outDiv.UpdateTimer = function (interval, status){
		if ("timer_id" in this && this.timer_id != null){
			clearTimeout(this.timer_id);
			this.timer_id = null;
		}
		var outter_this = this;
		// 为了调用OnTimer函数中有this 指针，必须使用闭包
		function TimeoutWrapper(){
			outter_this.OnTimer();
		}
		this.timer_id = setTimeout(TimeoutWrapper, interval);
		this.status = status;
	}
}
// 检查是否属于孩子
function IsChildOf(parent, child)
{
	var upper_parent = child.parentNode;
	while (upper_parent != null) {
		if (upper_parent == parent) {
			return true;
		}
		upper_parent = upper_parent.parentNode;
	}
	return false;
}

function showAllSize(innDiv, ulList, aAllSize, divAllSize) {
	var obj_innDiv = document.getElementById(innDiv);
	var obj_ulList = document.getElementById(ulList);
	var obj_aAllSize = document.getElementById(aAllSize);
	var obj_divAllSize = document.getElementById(divAllSize);
	obj_divAllSize.style.display = "block";
	obj_ulList.style.display = "none";
	obj_innDiv.style.width = obj_divAllSize.offsetWidth + "px";
	if (obj_divAllSize.offsetHeight > 300) {
		obj_divAllSize.style.width = 289 + "px";
		obj_divAllSize.style.height = 300 + "px";
		obj_divAllSize.style.overflowY = "scroll";
		obj_divAllSize.style.overflowX = "hidden";
	}
}


function search_goods2(t) {

    //sizes filter
    var para = [];
    if(t == 's') {
        _config.sizes = arguments[1];
    }

    //stock filter
    if(t == 'c') {
        _config.filter = _config.filter? 0 :1 ;
    }

	if( t == 'p') {
		_config.sort = arguments[1];
	}

    for(var i in _config) {
        if(_config[i])
            para.push(i + '=' + _config[i]);
    }

    var base_url = 'merchandise.php?' + para.join('&');

	location = base_url;
}